Integrand size = 18, antiderivative size = 296 \[ \int \frac {e+f x}{(a+b \cos (c+d x))^2} \, dx=-\frac {i a (e+f x) \log \left (1+\frac {b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d}+\frac {i a (e+f x) \log \left (1+\frac {b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d}-\frac {f \log (a+b \cos (c+d x))}{\left (a^2-b^2\right ) d^2}-\frac {a f \operatorname {PolyLog}\left (2,-\frac {b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d^2}+\frac {a f \operatorname {PolyLog}\left (2,-\frac {b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d^2}-\frac {b (e+f x) \sin (c+d x)}{\left (a^2-b^2\right ) d (a+b \cos (c+d x))} \]
[Out]
Time = 0.79 (sec) , antiderivative size = 296, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.444, Rules used = {3405, 3402, 2296, 2221, 2317, 2438, 2747, 31} \[ \int \frac {e+f x}{(a+b \cos (c+d x))^2} \, dx=-\frac {a f \operatorname {PolyLog}\left (2,-\frac {b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{d^2 \left (a^2-b^2\right )^{3/2}}+\frac {a f \operatorname {PolyLog}\left (2,-\frac {b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{d^2 \left (a^2-b^2\right )^{3/2}}-\frac {f \log (a+b \cos (c+d x))}{d^2 \left (a^2-b^2\right )}-\frac {i a (e+f x) \log \left (1+\frac {b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{d \left (a^2-b^2\right )^{3/2}}+\frac {i a (e+f x) \log \left (1+\frac {b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{d \left (a^2-b^2\right )^{3/2}}-\frac {b (e+f x) \sin (c+d x)}{d \left (a^2-b^2\right ) (a+b \cos (c+d x))} \]
[In]
[Out]
Rule 31
Rule 2221
Rule 2296
Rule 2317
Rule 2438
Rule 2747
Rule 3402
Rule 3405
Rubi steps \begin{align*} \text {integral}& = -\frac {b (e+f x) \sin (c+d x)}{\left (a^2-b^2\right ) d (a+b \cos (c+d x))}+\frac {a \int \frac {e+f x}{a+b \cos (c+d x)} \, dx}{a^2-b^2}+\frac {(b f) \int \frac {\sin (c+d x)}{a+b \cos (c+d x)} \, dx}{\left (a^2-b^2\right ) d} \\ & = -\frac {b (e+f x) \sin (c+d x)}{\left (a^2-b^2\right ) d (a+b \cos (c+d x))}+\frac {(2 a) \int \frac {e^{i (c+d x)} (e+f x)}{b+2 a e^{i (c+d x)}+b e^{2 i (c+d x)}} \, dx}{a^2-b^2}-\frac {f \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \cos (c+d x)\right )}{\left (a^2-b^2\right ) d^2} \\ & = -\frac {f \log (a+b \cos (c+d x))}{\left (a^2-b^2\right ) d^2}-\frac {b (e+f x) \sin (c+d x)}{\left (a^2-b^2\right ) d (a+b \cos (c+d x))}+\frac {(2 a b) \int \frac {e^{i (c+d x)} (e+f x)}{2 a-2 \sqrt {a^2-b^2}+2 b e^{i (c+d x)}} \, dx}{\left (a^2-b^2\right )^{3/2}}-\frac {(2 a b) \int \frac {e^{i (c+d x)} (e+f x)}{2 a+2 \sqrt {a^2-b^2}+2 b e^{i (c+d x)}} \, dx}{\left (a^2-b^2\right )^{3/2}} \\ & = -\frac {i a (e+f x) \log \left (1+\frac {b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d}+\frac {i a (e+f x) \log \left (1+\frac {b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d}-\frac {f \log (a+b \cos (c+d x))}{\left (a^2-b^2\right ) d^2}-\frac {b (e+f x) \sin (c+d x)}{\left (a^2-b^2\right ) d (a+b \cos (c+d x))}+\frac {(i a f) \int \log \left (1+\frac {2 b e^{i (c+d x)}}{2 a-2 \sqrt {a^2-b^2}}\right ) \, dx}{\left (a^2-b^2\right )^{3/2} d}-\frac {(i a f) \int \log \left (1+\frac {2 b e^{i (c+d x)}}{2 a+2 \sqrt {a^2-b^2}}\right ) \, dx}{\left (a^2-b^2\right )^{3/2} d} \\ & = -\frac {i a (e+f x) \log \left (1+\frac {b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d}+\frac {i a (e+f x) \log \left (1+\frac {b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d}-\frac {f \log (a+b \cos (c+d x))}{\left (a^2-b^2\right ) d^2}-\frac {b (e+f x) \sin (c+d x)}{\left (a^2-b^2\right ) d (a+b \cos (c+d x))}+\frac {(a f) \text {Subst}\left (\int \frac {\log \left (1+\frac {2 b x}{2 a-2 \sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{\left (a^2-b^2\right )^{3/2} d^2}-\frac {(a f) \text {Subst}\left (\int \frac {\log \left (1+\frac {2 b x}{2 a+2 \sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{\left (a^2-b^2\right )^{3/2} d^2} \\ & = -\frac {i a (e+f x) \log \left (1+\frac {b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d}+\frac {i a (e+f x) \log \left (1+\frac {b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d}-\frac {f \log (a+b \cos (c+d x))}{\left (a^2-b^2\right ) d^2}-\frac {a f \operatorname {PolyLog}\left (2,-\frac {b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d^2}+\frac {a f \operatorname {PolyLog}\left (2,-\frac {b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} d^2}-\frac {b (e+f x) \sin (c+d x)}{\left (a^2-b^2\right ) d (a+b \cos (c+d x))} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(933\) vs. \(2(296)=592\).
Time = 10.62 (sec) , antiderivative size = 933, normalized size of antiderivative = 3.15 \[ \int \frac {e+f x}{(a+b \cos (c+d x))^2} \, dx=\frac {-b d e \sin (c+d x)+b c f \sin (c+d x)-b f (c+d x) \sin (c+d x)}{(a-b) (a+b) d^2 (a+b \cos (c+d x))}+\frac {\cos ^2\left (\frac {1}{2} (c+d x)\right ) \left (\frac {2 a (d e-c f) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}}+f \log \left (\sec ^2\left (\frac {1}{2} (c+d x)\right )\right )-f \log \left ((a+b \cos (c+d x)) \sec ^2\left (\frac {1}{2} (c+d x)\right )\right )-\frac {i a f \left (\log \left (1-i \tan \left (\frac {1}{2} (c+d x)\right )\right ) \log \left (\frac {\sqrt {a+b}-\sqrt {-a+b} \tan \left (\frac {1}{2} (c+d x)\right )}{i \sqrt {-a+b}+\sqrt {a+b}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {-a+b} \left (1-i \tan \left (\frac {1}{2} (c+d x)\right )\right )}{\sqrt {-a+b}-i \sqrt {a+b}}\right )\right )}{\sqrt {-a+b} \sqrt {a+b}}+\frac {i a f \left (\log \left (1-i \tan \left (\frac {1}{2} (c+d x)\right )\right ) \log \left (\frac {i \left (\sqrt {a+b}+\sqrt {-a+b} \tan \left (\frac {1}{2} (c+d x)\right )\right )}{\sqrt {-a+b}+i \sqrt {a+b}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {-a+b} \left (1-i \tan \left (\frac {1}{2} (c+d x)\right )\right )}{\sqrt {-a+b}+i \sqrt {a+b}}\right )\right )}{\sqrt {-a+b} \sqrt {a+b}}-\frac {i a f \left (\log \left (1+i \tan \left (\frac {1}{2} (c+d x)\right )\right ) \log \left (\frac {\sqrt {a+b}+\sqrt {-a+b} \tan \left (\frac {1}{2} (c+d x)\right )}{i \sqrt {-a+b}+\sqrt {a+b}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {-a+b} \left (1+i \tan \left (\frac {1}{2} (c+d x)\right )\right )}{\sqrt {-a+b}-i \sqrt {a+b}}\right )\right )}{\sqrt {-a+b} \sqrt {a+b}}+\frac {i a f \left (\log \left (1+i \tan \left (\frac {1}{2} (c+d x)\right )\right ) \log \left (\frac {i \left (\sqrt {a+b}-\sqrt {-a+b} \tan \left (\frac {1}{2} (c+d x)\right )\right )}{\sqrt {-a+b}+i \sqrt {a+b}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {-a+b} \left (1+i \tan \left (\frac {1}{2} (c+d x)\right )\right )}{\sqrt {-a+b}+i \sqrt {a+b}}\right )\right )}{\sqrt {-a+b} \sqrt {a+b}}\right ) (a d e+a d f x+b f \sin (c+d x)) \left (\sqrt {a+b}-\sqrt {-a+b} \tan \left (\frac {1}{2} (c+d x)\right )\right ) \left (\sqrt {a+b}+\sqrt {-a+b} \tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2-b^2\right ) d^2 (a+b \cos (c+d x)) \left (a \left (d e-c f+i f \log \left (1-i \tan \left (\frac {1}{2} (c+d x)\right )\right )-i f \log \left (1+i \tan \left (\frac {1}{2} (c+d x)\right )\right )\right )+b f \sin (c+d x)\right )} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 673 vs. \(2 (270 ) = 540\).
Time = 3.34 (sec) , antiderivative size = 674, normalized size of antiderivative = 2.28
method | result | size |
risch | \(\frac {2 i \left (f x +e \right ) \left (a \,{\mathrm e}^{i \left (d x +c \right )}+b \right )}{d \left (-a^{2}+b^{2}\right ) \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 a \,{\mathrm e}^{i \left (d x +c \right )}+b \right )}-\frac {2 f \ln \left ({\mathrm e}^{i \left (d x +c \right )}\right )}{\left (-a^{2}+b^{2}\right ) d^{2}}+\frac {f \ln \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 a \,{\mathrm e}^{i \left (d x +c \right )}+b \right )}{\left (-a^{2}+b^{2}\right ) d^{2}}+\frac {2 i a e \arctan \left (\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}+2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{\left (-a^{2}+b^{2}\right )^{\frac {3}{2}} d}+\frac {i f a \ln \left (\frac {-b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {a^{2}-b^{2}}-a}{\sqrt {a^{2}-b^{2}}-a}\right ) x}{\left (-a^{2}+b^{2}\right ) d \sqrt {a^{2}-b^{2}}}-\frac {i f a \ln \left (\frac {b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {a^{2}-b^{2}}+a}{\sqrt {a^{2}-b^{2}}+a}\right ) x}{\left (-a^{2}+b^{2}\right ) d \sqrt {a^{2}-b^{2}}}+\frac {i f a \ln \left (\frac {-b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {a^{2}-b^{2}}-a}{\sqrt {a^{2}-b^{2}}-a}\right ) c}{\left (-a^{2}+b^{2}\right ) d^{2} \sqrt {a^{2}-b^{2}}}-\frac {i f a \ln \left (\frac {b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {a^{2}-b^{2}}+a}{\sqrt {a^{2}-b^{2}}+a}\right ) c}{\left (-a^{2}+b^{2}\right ) d^{2} \sqrt {a^{2}-b^{2}}}+\frac {f a \operatorname {dilog}\left (\frac {-b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {a^{2}-b^{2}}-a}{\sqrt {a^{2}-b^{2}}-a}\right )}{\left (-a^{2}+b^{2}\right ) d^{2} \sqrt {a^{2}-b^{2}}}-\frac {f a \operatorname {dilog}\left (\frac {b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {a^{2}-b^{2}}+a}{\sqrt {a^{2}-b^{2}}+a}\right )}{\left (-a^{2}+b^{2}\right ) d^{2} \sqrt {a^{2}-b^{2}}}-\frac {2 i a f c \arctan \left (\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}+2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{\left (-a^{2}+b^{2}\right )^{\frac {3}{2}} d^{2}}\) | \(674\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1482 vs. \(2 (266) = 532\).
Time = 0.46 (sec) , antiderivative size = 1482, normalized size of antiderivative = 5.01 \[ \int \frac {e+f x}{(a+b \cos (c+d x))^2} \, dx=\text {Too large to display} \]
[In]
[Out]
Timed out. \[ \int \frac {e+f x}{(a+b \cos (c+d x))^2} \, dx=\text {Timed out} \]
[In]
[Out]
Exception generated. \[ \int \frac {e+f x}{(a+b \cos (c+d x))^2} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
\[ \int \frac {e+f x}{(a+b \cos (c+d x))^2} \, dx=\int { \frac {f x + e}{{\left (b \cos \left (d x + c\right ) + a\right )}^{2}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {e+f x}{(a+b \cos (c+d x))^2} \, dx=\text {Hanged} \]
[In]
[Out]